package idun.service;

import idun.dao.RestaurantDao;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

@Service
public class LunchPicker {
	@Autowired
	private RestaurantDao restaurantDao;

	public static void main(String[] args) {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		try {
			LunchPicker lunchPicker = context.getBean(LunchPicker.class);
			lunchPicker.pickeRestaurant(10);
		} catch (BeansException e) {
			e.printStackTrace();
		} finally {
			context.close();
		}
	}

	public void pickeRestaurant(int peopleCount) {
		System.out.println("餐飲人數:" + peopleCount);
		System.out.println("restaurantDao:" + restaurantDao);
	}

}
